<template>
  <div class="mask">
    <div class="wrap">
      <div class="head">
        本关排行
      </div>
      <div class="list">
        <div class="list-item" v-for="(item,index) in list" :key="index">
          <div class="rank">{{index+1}}</div>
          <img v-if="item.obj.headImgUrl" :src="item.obj.headImgUrl" alt="">
          <img v-else src="/static/default-head.png" alt="">
          <div class="name">{{item.obj.nickname}}</div>
          <div class="card">{{item.obj.smallCard}}/10关</div>
        </div>
      </div>
      <div class="btn" @click="close()">我知道了</div>
    </div>
  </div>

</template>
<script>
export default {
  props:['list'],
  data() {
    return {};
  },
  methods:{
    close(){
      this.$emit('close');
    }
  }
};
</script>

<style lang="scss" scoped>
.mask {
  width: 100%;
  height: 100%;
  background: rgba(#000, 0.2);
  position: fixed;
  z-index: 20;
}
.wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 580rpx;
  height: 670rpx;
  border: 8rpx solid #fff;
  border-radius: 8rpx;
  z-index: 30;
  background: #fff;
}
.head {
  font-size: 48rpx;
  font-weight: bold;
  text-align: center;
  padding: 28rpx 0;
  line-height: 1;
  background: #f46185;
  color: #fff;
}
.list{
  width: 100%;
  height: 456rpx;
  min-height: 228rpx;
  overflow: scroll;
}
.list-item {
  padding: 0 20rpx;
  height: 114rpx;
  display: flex;
  align-items: center;
  position: relative;
  .card,
  .rank {
    font-size: 30rpx;
    color: #f46087;
    font-weight: bold;
  }
  .rank {
    width: 55rpx;
    text-align: center;
  }
  img {
    width: 68rpx;
    height: 68rpx;
    border-radius: 50%;
    margin-right: 30rpx;
  }
  .name {
    font-size: 30rpx;
    color: #aaa;
    font-weight: bold;
  }
  .card {
    width: 135rpx;
    text-align: center;
    position: absolute;
    right: 20rpx;
    top: 50%;
    transform: translateY(-50%);
  }
}
.btn{
  width: 230rpx;
  height: 84rpx;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border: 3rpx solid #e55f80;
  font-size: 30rpx;
  color: #e55f80;
}
</style>
